<template>
	<view>
		<wd-status-tip image="content" v-if="anntMsgList.length === 0 " tip="暂无通知公告" />
		<wd-cell-group border v-else>
		  <wd-cell v-for="(msg , index) in anntMsgList" :key="index" icon="notification" title-width="200px" :label="msg.msgAbstract" :value="msg.sendTime" clickable @click="detail(msg)" >
			 <template #title>
				 <view class="mesTitle">
				 	{{msg.titile}}
				 </view>
			 </template>
		  </wd-cell>
		</wd-cell-group>
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import userApiService from '@/api/user';
	const anntMsgList = ref([])
	
	userApiService.getAnnountCementList().then(res =>{
		anntMsgList.value = res.records
	})
	
	const detail = (e) =>{
		uni.navigateTo({
			url:`/pages/notice/detail?id=${e.id}`
		})
	}
</script>

<style lang="scss">
.content{
	min-height: calc(90vh - var(--status-bar-height));
}
.mesTitle{
	width: 85%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
</style>
